package com.isp.org.server.interfaces.model.group.mapper;

import com.isp.common.model.user.GroupDTO;
import com.isp.org.server.domain.entity.GroupEntity;
import com.isp.org.server.interfaces.model.group.request.CreateGroupRequest;
import com.isp.org.server.interfaces.model.group.request.UpdateGroupRequest;
import com.isp.org.server.interfaces.model.group.response.GroupDetailResponse;
import com.isp.org.server.interfaces.model.group.response.GroupListResponse;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * @author linsy
 * @version 1.0
 * @created 2024/3/12 14:46
 */
@Mapper
public interface GroupMapStruct {
    GroupMapStruct INSTANCE = Mappers.getMapper(GroupMapStruct.class);

    GroupEntity createToEntity(CreateGroupRequest request);

    GroupEntity updateToEntity(UpdateGroupRequest request);

    GroupDetailResponse entityToDetail(GroupEntity groupEntity);

    GroupListResponse entityToList(GroupEntity entity);

    List<GroupListResponse> entitiesToLists(List<GroupEntity> groupEntities);

    GroupDTO entityToDto(GroupEntity groupEntity);

    List<GroupDTO> entitiesToDtoList(List<GroupEntity> groupEntities);
}
